package com.cmc.cloud.cmclink.doc.api.document.rep.manifestrep.manifestcargo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 舱单货物信息 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author chenzheng
 */
@Data
public class ManifestCargoBaseVO {

    @Schema(description = "外键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26876")
    private Long manifestId;

    @Schema(description = "货类", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotBlank(message = "{manifestcargo.cargotype.notblank}")
    @Length(max = 5, message = "{manifestcargo.cargotype.length}")
    private String cargoType;

    @Schema(description = "HS Code", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{manifestcargo.hscode.notblank}")
    @Length(max = 12, message = "{manifestcargo.hscode.length}")
    private String hsCode;

    @Schema(description = "英文品名")
    @Length(max = 4000, message = "{manifestcargo.commodityen.length}")
    private String commodityEn;

    @Schema(description = "中文品名")
    @Length(max = 1000, message = "{manifestcargo.commoditycn.length}")
    private String commodityCn;

    @Schema(description = "预估毛重（kgs）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "{manifestcargo.grossweight.notnull}")
    @Min(value = 0, message = "{manifestcargo.grossweight.min}")
    private BigDecimal grossWeight;

    @Schema(description = "温度（℃） 温度范围在-25℃至25℃ 之间。")
    @Length(max = 4, message = "{manifestcargo.temperature.length}")
    private String temperature;

    @Schema(description = "C 摄氏度,F华氏")
    @Length(max = 1, message = "{manifestcargo.temperatureunit.length}")
    private String temperatureUnit;

    @Schema(description = "通风度 开度（% Open，范围0~100%）；风量（CHM，单位：m³/h，范围0~999）")
    @Length(max = 50, message = "{manifestcargo.vantilation.length}")
    private String vantilation;

    @Schema(description = "unno")
    @Length(max = 50, message = "{manifestcargo.unno.length}")
    private String unNo;

    @Schema(description = "imoclass")
    @Length(max = 50, message = "{manifestcargo.imoclass.length}")
    private String imoClass;

    @Schema(description = "闪点特种货带过来的")
    @Length(max = 50, message = "{manifestcargo.flashpoint.length}")
    private String flashPoint;

    @Schema(description = "包装组别三个选项：Ⅰ、Ⅱ、Ⅲ")
    @Length(max = 5, message = "{manifestcargo.packinggroup.length}")
    private String packingGroup;

    @Schema(description = "唛头")
    @Length(max = 4000, message = "{manifestcargo.mark.length}")
    private String marks;

    @Schema(description = "件数")
    @NotNull(message = "{manifestcargo.quantity.notnull}")
    @Min(value = 1, message = "{manifestcargo.quantity.min}")
    private Integer quantity;

    @Schema(description = "尺寸")
    @NotNull(message = "{manifestcargo.measurement.notnull}")
    @Min(value = 0, message = "{manifestcargo.measurement.min}")
    private BigDecimal measurement;

    @Schema(description = "包装代码")
    @Length(max = 50, message = "{manifestcargo.packagecode.length}")
    private String packageCode;

    @Schema(description = "包装描述")
    @Length(max = 50, message = "{manifestcargo.packagedesc.length}")
    private String packageDesc;

}
